﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using DLL;

public partial class myCJForm : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        landInfo landInfo = (landInfo)Session["landInfo"];
        if (!IsPostBack)
        {
            gvCJ.DataSource = cj_BLL.GetCJInfo(landInfo.UserName);
            gvCJ.DataBind();
        }
        viewIsNoData();
    }

    #region 脚本
    /// <summary>
    /// 如果GridView中没有数据则显示提示信息
    /// </summary>
    protected void viewIsNoData()
    {
        if (gvCJ.Rows.Count == 0)
        {
            RegisterStartupScript("prompt", "<script type='text/javascript'>document.getElementById('divBrowse').innerHTML='(尚未找到相关数据)'</script>");
        }
    }
    /// <summary>
    /// 显示报消息窗口
    /// </summary>
    /// <param name="Msg"></param>
    private void MsgBoxShow(string Msg)
    {
        RegisterStartupScript("Msg", "<script type='text/javascript' language='javascript'>alert('" + Msg + "')</script>");
    }
    #endregion
}
